import { DictDataVO } from "./types";
import { http } from "@/utils/http";
import { BasicResult } from "#/resultType";
// import { useMessage } from "@/hooks/useMessage";

enum API {
  GET_DICT_DATA_TYPE = "/system/dict/data/type"
}
export const getDicts = (dictType: string) => {
  return new Promise<BasicResult<DictDataVO[]>>(async (resolve, reject) => {
    try {
      const res = await http.get<{}, BasicResult<DictDataVO[]>>(
        `${API.GET_DICT_DATA_TYPE}/${dictType}`
      );
      resolve(res);
    } catch (error) {
      reject(error);
    }
  });
};
